package mx.edu.itesm.daai.tour;

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.*;
import javax.servlet.ServletConfig;

/**
 * TourOficinasServlet returns a tour of the Offices Buildings in ITESM CCM
 *
 * @author Shadow X-tar
 */
public class TourAulasServlet extends HttpServlet
{
	private TourGenerator tour;

	 //Initiate Manager
	  public void init(ServletConfig config) throws ServletException {
		    super.init(config);
		    this.tour= new TourGenerator();
	  }

	// Redirect all Gets to Posts so that we can also view the results
	// in all web browsers.
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException
	{
	    doPost(request, response);
	}
    /**
     *  Sends a KLM with a random city placement in as response
     */
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException
	{
	    response.setContentType("application/keyhole");
	    PrintWriter out = response.getWriter();
	    out.println(tour.aulas());
	}

}